<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <title>Insert title here</title>

    <script type="text/javascript">
    function addButton(){
    var html ="<input type=\"button\" value=\"新加\" onclick=\"newButton();\">";
    document.getElementById("add").innerHTML=html;
    }
    function newButton(){
    alert("我是新加的按钮");
    }

     function toastmessage(message){
        alert(message);
    }

    function actionFromNative(){
        alert(Scan.sendJsToData());
    }
    //跳转页面
    function intentNext(){
           window.location.href="file:///android_asset/html/login.html";
    }
    </script>

</head>
<body>


<div>
    <p>点击该按钮增加一个新按钮</p>
    <input type="button" value="点击增加" onclick="addButton();">

    <p>新增的按钮在这显示</p>
    <div id="add"></div>

    <p>点击该按钮开启扫码页面</p>
    <input type="button" value="调用java方法scanCode" onclick="scan()"/>
    <script>

         function scan(){
             window.Scan.scanCode("toastmessage");
         }


    </script>
    <p>安卓向js页面传递数据</p>
    <button onclick="javascrtpt:actionFromNative()">点击调用java代码并接收传递的参数</button>

    <p id="from">跳转第二个h5页面</p>
    <a href="file:///android_asset/html/login.html">点击</a>
</div>


</body>
</html>